<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>标题</h1>
    <script>
        window.onmousedown = function(mouseEvent) {
            console.log(mouseEvent.button);  //<- Error
        };
    </script>
</body>
</html>